<template>
  <div style="display: flex ; line-height: 50px">
    <div style="line-height: 60px;">
      <i :class="icon" style="font-size: 20px" @click="collapse"></i>
    </div>
    <div style="flex: 1;text-align: center">
      <span style="font-size: 34px">
        欢迎来到管理系统
      </span>
    </div>
    <el-dropdown>
      <span>王小虎</span> <i class="el-icon-arrow-down" style="margin-left: 10px"></i>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item @click.native="toUser">个人中心</el-dropdown-item>
        <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>

<script>
export default {
  name: "Header",
  props:{
    icon:String
  },
  methods: {
    toUser() {
      console.log("to_user")
    },
    logout() {
      console.log("logout")
    },
    collapse(){
      this.$emit('doCollapse')
    }
  }
}
</script>
<style scoped>
</style>